#build filelist
set f [open file.f "w"]
set rtl_list [glob -directory ../rtl *.v]
foreach rtl $rtl_list {
	puts $f $rtl
}
set tb_list [glob -directory ../tb *.v]
foreach tb $tb_list {
	puts $f $tb
}
close $f

#build work
if {[file exist work]} {
	file delete -force work
}

vlib work
vmap work work

#set var
set altera {D:\questasim_10.1b\lib\altera};


#compile

vlog -work work -f file.f


#vlog  -work work -f file.f

#sim
vsim -L $altera -voptargs=+acc -wlf sim.wlf -pli novas.dll -debugDB=sim.dbg work.tb_top

#run
run -all
